//
//  PKPublishSocialShareView.swift
//  Panku
//
//  Created by mac on 2017/5/28.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKPublishSocialShareView: PKBaseView {

    //MARK: - UI
    lazy var coverView = UIView()
    lazy var containerView = UIView()
    lazy var weiboButton = PKBaseButton.createButton()
    lazy var timelineButton = PKBaseButton.createButton()
    lazy var qqzoneButton = PKBaseButton.createButton()
    lazy var wechatButton = PKBaseButton.createButton()
    lazy var qqButton = PKBaseButton.createButton()
    
    
    override func setupView() {
        
        self.addSubview(coverView)
        self.addSubview(containerView)
        self.addSubview(weiboButton)
        self.addSubview(timelineButton)
        self.addSubview(qqzoneButton)
        self.addSubview(wechatButton)
        self.addSubview(qqButton)
        
        
        coverView.backgroundColor = UIColor.black
        coverView.alpha = 0.3
        
        containerView.backgroundColor = UIColor.white
        containerView.layer.cornerRadius = 10
        containerView.layer.masksToBounds = true
        
        weiboButton.setImage(R.image.share_weibo(), for: .normal)
        timelineButton.setImage(R.image.share_timeline(), for: .normal)
        qqzoneButton.setImage(R.image.share_qqzone(), for: .normal)
        wechatButton.setImage(R.image.share_wechat(), for: .normal)
        qqButton.setImage(R.image.share_qq(), for: .normal)
        
        coverView.snp.makeConstraints { (make) in
            make.edges.equalTo(self)
        }
        
        containerView.snp.makeConstraints { (make) in
            make.center.equalTo(self.snp.center)
            make.width.equalTo(APP_WIDTH*2/3)
            make.height.equalTo(150)
        }
        
        timelineButton.snp.makeConstraints { (make) in
            make.centerX.equalTo(containerView.snp.centerX)
            make.top.equalTo(containerView.snp.top).offset(32)
        }
        
        weiboButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(timelineButton.snp.centerY)
            make.right.equalTo(timelineButton.snp.left).offset(39)
        }
        
        qqzoneButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(timelineButton.snp.centerY)
            make.left.equalTo(timelineButton.snp.right).offset(39)
        }
        
        wechatButton.snp.makeConstraints { (make) in
            make.top.equalTo(timelineButton.snp.bottom).offset(27)
            make.right.equalTo(timelineButton.snp.left)
        }
        
        qqButton.snp.makeConstraints { (make) in
            make.top.equalTo(timelineButton.snp.bottom).offset(27)
            make.left.equalTo(timelineButton.snp.right)
        }
        
    }
    

}
